import ins from ".";
//登录验证
export function checkUser(obj){
  return ins({
    method:"POST",
    url:"/login",
    data:{
      obj
    }
  })
}
//获取全部数据
export function getList(){
  return ins({
    method:"GET",
    url:"/Carts",
  })
}

//添加
export function add(obj){
  return ins({
    method:"POST",
    url:"/Carts",
    data:obj
  })
}

//删除
export function del(id){
  return ins({
    method:"DELETE",
    url:`/Carts/${id}`,
  })
}

//回显
export function hui(id){
  return ins({
    method:"GET",
    url:`/Carts/${id}`,
  })
}

//修改
export function edit(id,obj){
  return ins({
    method:"PATCH",
    url:`/Carts/${id}`,
    data:obj
  })
}

//模糊搜索
export function search(obj){
  const str = new URLSearchParams(obj).toString()
  return ins({
    method:"GET",
    url:`/Carts?${str}`,
  })
}